package com.hzlj.position.locate.converter;

import com.hzlj.position.locate.common.dto.abnMissingJzryNotice.AbnMissingJzryNoticeAddDTO;
import com.hzlj.position.locate.common.dto.abnMissingJzryNotice.AbnMissingJzryNoticeQueryResultDTO;
import com.hzlj.position.locate.common.model.AbnMissingJzryNotice;
import com.fz.common.base.converter.ModelDTOConverter;
import com.fz.common.base.core.date.DateUtils;

/**
 * 定位分析-疑似失联人员-通知(AbnMissingJzryNotice)DTO转换类
 *
 * @author makejava
 * @date 2024-06-26 10:38:16
 */
public class AbnMissingJzryNoticeConverter {
    /**
     * model实例转换为查询结果DTO
     *
     * @param model model实例
     * @return DTO
     */
    public static AbnMissingJzryNoticeQueryResultDTO from(AbnMissingJzryNotice model) {
        return ModelDTOConverter.from(model, AbnMissingJzryNoticeQueryResultDTO.class);
    }
    
    /**
     * 新增DTO转换为model实例
     *
     * @param dto 新增DTO
     * @return model实例
     */
    public static AbnMissingJzryNotice from(AbnMissingJzryNoticeAddDTO dto) {
        return ModelDTOConverter.from(dto, AbnMissingJzryNotice.class,(AbnMissingJzryNotice l) -> {
            l.setValid(true);
            l.setUpdateTime(DateUtils.now());
            l.setCreateTime(DateUtils.now());
        });
        
    }

}
